#pragma once

#include"RBTree.h"
namespace Long
{
	template<class K>
	class set
	{
		struct SetKey
		{
			const K& operator()(const K& n)
			{
				return n;
			}
		};
	private:
		RB::RBTree<K, K,SetKey> _t;
	public:
		typedef typename RB::RBTree<K, K, SetKey>::iterator iterator;
		set()
		{}
		bool Insert(const K& data)
		{
			pair<iterator, bool> p = _t.Insert(data);
			return p.second;
		}
		iterator begin()
		{
			return _t.begin();
		}
		iterator end()
		{
			return _t.end();
		}
	};
	void TestSet1()
	{
		set<int> p;
		int arr[] = { 2, 6, 7, 1, 4, 9, 3 };
		for (auto e : arr)
		{
			p.Insert(e);
		}

		for (auto e : p)
		{
			cout << e << " ";
		}
		cout << endl;
	}
}